package HeSuanServer.controller;

import HeSuanServer.POJO.Admin;
import HeSuanServer.POJO.R.Result;
import HeSuanServer.service.AdminService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @描述:
 * @author: LH
 * @date: 2022/12/7
 */
@CrossOrigin
@RequestMapping("admin")
@RestController
@Slf4j
public class adminController {
    @Autowired
    private AdminService adminService;
    @PostMapping("login")
    public Result adminLogin(@RequestBody Admin ad){
        return adminService.login(ad);
    }
    @PostMapping("token")
    public Result token(HttpServletRequest request){
        return adminService.analysisToken(request);
    }
}
